<template>
  <div>
    <el-carousel :interval="4000" type="card" height="100px">
      <el-carousel-item v-for="item in cate" :key="item.id">
        <div class="box">
          <dl>
            <dd @click="getitem(item.id)"><img :src="item.icon" alt="" /></dd>
            <dt>{{ item.name }}</dt>
          </dl>
        </div>
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<script>
export default {
  props: {
    cate: []
  },
  methods: {
    getitem (id) {
      this.$emit('getitem', id)
      console.log(id)
    }
  }
}
</script>

<style lang="scss" scoped>
// div {
//   // background-color: #39a9ed;
// }
/deep/.el-carousel__arrow {
  display: none;
}
/deep/.el-carousel__indicator {
  display: none;
}
/deep/.el-carousel__container{
   background-color: #bed4fa;
}
.box{
  height: 100px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 10px;
}
.el-carousel__item {
  // color: #1472ee;
  // font-size: 14px;
  // // opacity: 0.75;
  // line-height: 100px;
  margin: 0;
  dl {
    width: 100%;
    height: 2.7778rem;
    dd {
      width: 100%;
      height: 1.6667rem;
      img {
        display: block;
        height: 1.6667rem;
        margin: 0 auto;
        border-radius: 50%;
      }
    }
    dt {
      color: rgb(21, 5, 114);
      text-align: center;
      font-size: 16px;
    }
  }
}
.el-carousel__item {
  background-color: #bed4fa;
}
// .el-carousel__item:nth-child(2n) {
//   background-color: #99a9bf;
// }
// .el-carousel__item:nth-child(2n + 1) {
//   background-color: #d3dce6;
// }
</style>
